 function out = L1Denoising( str )
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
if nargin ==0 
    I = rgb2gray(imread('yuna.jpg'));
    I = double(imnoise(I,'gaussian',0,0.03));
    I = double(I(100:500,100:500));
    I = (I - min(I(:)))/(max(I(:)) - min(I(:)));
else 
    I = double(imread( str ));
end


%%
nIterations = 100;
lambda = 1.2;
tau  =  0.03;
sigma = 2;
theta = 1;
x = I;
xbar = x;
y = NeuGradient(x);
tic
for iter = 1 : nIterations
    xold = x;
    tmpy = y + sigma*NeuGradient(xbar);
    y = L2Proj(tmpy);  
    tmpx = x + tau*NeuDiv(y);
    %TV_L1
    x = soft_threshold(tmpx, tau*lambda,I);
    %TV_L2
    x = (x+0.5*tau*lambda*I)./(1+0.5*tau*lambda);
    xbar = x + theta*(x - xold);
    L1Energy(x,I,lambda);
end
toc
out = x;
 end
 

% end

